{{- $pages := (.Paginate .RegularPagesRecursive).Pages -}}
<div class="container">
  {{- if .IsHome -}}
    {{- $sections := default (slice "posts") .Site.Params.mainSections -}}
    {{- $pages = where (.Paginate .Site.RegularPages).Pages "Type" "in" $sections -}}
  {{- else -}}
  {{- partial "breadcrumb" . -}}
  {{- partial "sections" . -}}
  {{- end -}}
  {{- partial "hooks/list-begin" . -}}
  <div class="posts mb-4">
  {{- range $pages -}}
    <article class="post row surface">
      {{- if .Params.Images -}}
      <div class="post-thumbnail col-md-3 d-flex align-items-center justify-content-center">
        <img class="img-fluid" src="{{ index .Params.Images 0 | absURL }}" loading="lazy"/>
      </div>
      {{- end -}}
      <div class="post-body{{ if .Params.Images }} col-md-9{{ end }}">
        <h2 class="post-title mb-4"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
        {{- partial "post/meta" . -}}
        <div class="post-summary mb-3">
          {{- .Summary | truncate 320 -}}
        </div>
      </div>
    </article>
  {{- end -}}
  </div>
  {{- partial "hooks/list-end" . -}}
  {{- partial "pagination" . -}}
</div>
